<extend name="Public/base"/>

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>[{$title}] 列表</h2>
    </div>

    <div class="cf">
        <div class="fl">
            <empty name="model.extend">
                <div class="tools">
                    <a class="btn" href="{:U('Order/index?status=1')}">录入中</a>
                    <a class="btn" href="{:U('Order/index?status=2')}">审核中</a>
                    <a class="btn" href="{:U('Order/index?status=3')}">审核成功</a>
                    <a class="btn" href="{:U('Order/index?status=4')}">审核失败</a>
                </div>
            </empty>
        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" name="cid" class="search-input" value="{:I('title')}" placeholder="请输入身份证">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('Order/index')}"><i class="btn-search"></i></a>
            </div>
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table">
        <div class="data-table table-striped">
            <table>
                <!-- 表头 -->
                <thead>
                    <tr>
                        <th>业务员</th>
                        <th>借款人身份证</th>
                        <th>借款人姓名</th>
                        <th>借款人手机号</th>
                        <th>状态</th>
                        <th>动态时间</th>
                        <th>操作</th>
                    </tr>
                </thead>

                <!-- 列表 -->
                <tbody>
                    <volist name="data" id="val">
                        <tr>
                            <td>{$val.mname}</td>
                            <td>{$val.cid}</td>
                            <td>{$val.cname}</td>
                            <td>{$val.mobile_tel}</td>
                            <td>{$val.status|get_order_status}</td>
                            <td>{$val.update_time|date="Y-m-d H:i:s",###}</td>
                            <td>
                                <a target="_blank" href="{:U('Logs/index','oid='.$val[id])}">状态追踪</a>
                            </td>
                        </tr>
                    </volist>
                </tbody>
            </table>
        </div>
    </div>
    <div class="page">
        {$_page|default=''}
    </div>
</block>

<block name="script">
<script type="text/javascript">
$(function(){
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});

    //回车自动提交
    $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });

})
</script>
</block>
